package cnpm02.j2ee.group3.model;

import javax.persistence.AttributeOverride;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Table;
import javax.persistence.UniqueConstraint;

import org.hibernate.validator.NotNull;

@Entity
@Table(name = "LANGUAGE", uniqueConstraints = @UniqueConstraint(columnNames = {
		"Code"}))
@AttributeOverride(name = "id", column = @Column(name = "LanguageId"))
public class Language extends AbstractEntity implements Translatable {
	private static final long serialVersionUID = 1L;
	
	@NotNull
	@Column(name = "Code", nullable = false, length = 3, unique = true)
	private String code;
	
	public Language() {
		super();
	}

	public Language(String code) {
		super();
		this.code = code;
	}

	public void setCode(String code) {
		this.code = code;
	}

	public String getCode() {
		return code;
	}
}
